let mongoose=require('./db')

const Schema = mongoose.Schema

const cartSchema = new mongoose.Schema({
    bookTitle:String, //书籍标题
    bookAuthor:String,//作者
    bookCovers:Array,//书籍封面
    publishingHouse:String,//出版社
    appearance:String,//品相
    productDetails:String,//商品详情
    originalPrice:String,//原价格
    currentPrice:String,//现价格
    freight:String,//运费
    bookRatings:String,//书籍评分
    classify:String,//
    ing:String,
    lat:String,
    num:{
        type:Number,
        default:1
    },
    checked:{
        type:Boolean,
        default:false
    }
})

let cartModel = mongoose.model('cart',cartSchema,'cart')

// cartModel.create([     {
//             bookTitle:'《吞噬星空》',
//             bookAuthor:"我吃西红柿",
//             bookCovers:[
//                 "https://img14.360buyimg.com/n1/jfs/t1/89936/39/10906/227655/5e254bbbE7b994eb1/7990d77162cdd6ab.png",
//                 "https://i.gtimg.cn/qqlive/img/jpgcache/files/qqvideo/hori/3/324olz7ilvo2j5f.jpg",
//                 "https://img3.runjiapp.com/duoteimg/dtnew_newsup_img/202207/20220727114652_27416.jpg",
//                 "https://ts1.cn.mm.bing.net/th/id/R-C.96023d86704add7000fd4dda8b916ddf?rik=OC47lfmZe1wvmQ&riu=http%3a%2f%2fpuui.qpic.cn%2fvpic_cover%2fb33627vs694%2fb33627vs694_hz.jpg%2f1280&ehk=C%2flu4IWHidfspG1jrvvTC4Y%2b%2b1A%2f7Cxzczvgt7DyexY%3d&risl=&pid=ImgRaw&r=0"
//             ],
//             publishingHouse:"北京十月文艺出版社",
//             appearance:"九成新",
//             productDetails:"地球经历一场大灾难后引发了各物种的变异，优胜劣汰，主角罗峰得到陨墨星主人传承，成为地球三强者之一，与星空吞噬巨兽一战后失去肉身，夺舍成为星空吞噬兽，在体内世界育出人类分身，之后迈出地球，走向宇宙。",
//             originalPrice:"99.00",
//             currentPrice:"69.00",
//             freight:"包邮",
//             bookRatings:"9.8",
//             classify:'2',
//             lng: '115.49297990055841',
//             lat: '38.827894632071356',
//         },
//         {
//             bookTitle:'《肖生克的救赎》',
//             bookAuthor:"浩瀚馨语",
//             bookCovers:[
//                 "https://img14.360buyimg.com/n1/jfs/t1/103617/32/13813/357368/5e5dba2cEe5e05362/e16891c17b23e21f.jpg",
//                 "https://tse4-mm.cn.bing.net/th/id/OIP-C.vzaZlSNPoFUW372eQGVxYQHaK_?pid=ImgDet&rs=1",
//                 "https://ts1.cn.mm.bing.net/th/id/R-C.e326e4967a3a038ee949792c056df040?rik=Ge9zBpnSEwU2jg&riu=http%3a%2f%2fmall3.iqiyipic.com%2fmall%2f20171026%2fb9%2fca%2fmall_59f1812df6882e60af1fb9ca_1x1.jpg&ehk=UShYzpHgl4A4kB2fadoTUFy%2baz9KEWcF28sjkFp5YvY%3d&risl=&pid=ImgRaw&r=0",
//                 "https://pic1.zhimg.com/v2-83a1a104ba614f639df012f0883e732d_1440w.jpg?source=172ae18b",
//                 "https://img.zcool.cn/community/01240a5c45c10da801203d22737eac.jpg@3000w_1l_0o_100sh.jpg"
//             ],
//             publishingHouse:"北京十月文艺出版社",
//             appearance:"八成新",
//             productDetails:"做事有原则，做人有底线。即便充满光环的人也没有资格越界。他，是一名出色的外科医生，拯救危难患者无数，其中包括英模人物和老革命，让他身上充满了光环，并得到崇拜者的追求，但已经有家庭的他是否会越过这条人生底线呢？一次意外的手术失败，让他彻底跌下神坛。不但家庭破裂，也被赶下了令他钟爱的手术台，被发配到一个无法展示他精湛医术且充满死亡的病区。他该何去何从？从逆境中振作起来的他终于意识到，救死扶伤不一点不一定依靠精湛的医术，更需要爱",
//             originalPrice:"69.00",
//             currentPrice:"36.00",
//             freight:"包邮",
//             bookRatings:"9.5",
//             classify:'1',
//             lng: '115.50531311355005',
//             lat: '38.8351277031337',
//         }])

module.exports={cartModel}
